#pragma once

#include "InputUtil.h"

class Unit;

class PlayerContext
{
public:
	PlayerContext() { DrawingSelectionRect = false; mHoldingSelectButton = false; }

	void processPlayerInput(const input::Event & event);

	void setSelectedUnit(Unit & unit);
	void addSelectedUnit(Unit & unit);
	std::vector<Unit*> SelectedUnits;

	Point DrawSelectionRectStart;
	Point DrawSelectionRectEnd;
	bool DrawingSelectionRect;
private:
	void moveCommand(const Point & clickPos);
	Unit* checkForObjectSelection(const Point & clickPos);
	void checkForMultipleObjectSelection(const Point & p1, const Point & p2, std::vector<Unit*> & outUnits);

	bool mHoldingSelectButton;
	std::vector<Unit*> mTmpSelectedUnits;
};